#ifndef TCPSOCKET_H
#define TCPSOCKET_H
#include <QTcpSocket>
#include<QMetaObject>
#include<QThread>
#include<QTimer>
class TCPSocket:public QTcpSocket
{
    Q_OBJECT
    private:

    static TCPSocket* tcp_socket;
    QTimer *timer;
    TCPSocket();
    public:
    static TCPSocket* getInstance()
    {
        if(tcp_socket==nullptr)
            tcp_socket = new TCPSocket();
        return tcp_socket;
    }
    void TCPconnect();
    ~TCPSocket();
    void bind();
    bool isOpen();
    void myWrite(const QByteArray& data);
    void myRead(QByteArray &data);
    public slots:
    void startTimer();

};

#endif // TCPSOCKET_H
